package com.example.myapplication.ViewModel

import androidx.lifecycle.ViewModel
import com.example.myapplication.model.entity.ArticleEntity

class ArticleViewModel : ViewModel() {

    // 文章列表数据
    var list = listOf(
        ArticleEntity(
            "上海一公交失控坠河上海一公交失控坠河上海一公交失控坠河上海一公交失控坠河上海一公交失控坠河上海一公交失控坠河上海一公交失控坠河",
            "新浪微博",
            "2022-5-8"
        ), ArticleEntity(
            "唐山雷霆风暴行动落幕",
            "新浪微博",
            "2022-5-9"
        ), ArticleEntity(
            "上海坠河公交司机昏迷前让乘客下车",
            "知乎",
            "2022-4-8"
        ), ArticleEntity(
            "教育局回应高中用芒果重量暗喻考分",
            "虎扑论坛",
            "2022-1-8"
        ), ArticleEntity(
            "雪糕刺客的前身竟是东北大板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕刺客的前身竟是东北大板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕刺客的前身竟是东北大板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕刺客的前身竟是东北大板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕刺客的前身竟是东北大板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕刺客的前身竟是东北大板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕板",
            "新浪微博",
            "2022-5-1"
        ), ArticleEntity(
            "雪糕刺客",
            "新浪微博",
            "2022-5-1"
        )
    )
        private set

    private val htmlHeader = """
        <!DOCTYPE html>
        <html>
        <head>
        	<meta charset="utf-8">
        	<meta name="viewport" content="width=device-width, initial-scale=1">
        	<title></title>
<style type="text/css">
		img {
			max-width: 100!important;
		}
	</style>
        </head>
        <body>
    """.trimIndent()

    private val htmlFooter = """
        </body>
        </html>
    """.trimIndent()

    // 文章详情数据
    val content = """${htmlHeader}
        <img alt="Gitee — 基于 Git 的代码托管和研发协作平台" class="ui inline black image" height="28" src="https://gitee.com/static/images/logo-black.svg?t=158106664" title="Gitee — 基于 Git 的代码托管和研发协作平台" width="95">
        <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:center; widows:0">
      <span style="font-family:仿宋; font-size:14pt; font-weight:bold">会员积分说明</span></p>
    <p style="font-size:14pt; line-height:150%; margin:0pt; orphans:0; text-align:justify; widows:0"><span
        style="font-family:仿宋; font-size:14pt">一、积分政策是务本科技回馈会员用户的举措，只有成为务本科技</span><span
        style="font-family:仿宋; font-size:14pt">会员</span><span style="font-family:仿宋; font-size:14pt">后才能享有积分及权益</span>
    </p>${htmlFooter}
    """.trimIndent()
}
